package com.project.controller;

import com.project.entity.Question;
import com.project.entity.Reserve;
import com.project.entity.Result;
import com.project.service.QuestionService;
import com.project.service.ReserveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/reserve")
public class ReserveController {
    @Autowired
    private ReserveService reserveService;

    @RequestMapping("/save")
    public Result save(Reserve reserve) {
        Result result = new Result();
        try {
            System.out.println(reserve);
            reserveService.save(reserve);
            result.success("保存成功");
        }catch (Exception e) {
            e.printStackTrace();
            result.success("保存失败");
        }

        return result;

    }

}
